/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 头部导航 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* 语言选择器 */
.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255,255,255,0.3);
}

.language-selector label {
    font-size: 0.9rem;
}

.language-selector select {
    padding: 0.3rem 0.5rem;
    border: none;
    border-radius: 4px;
    background: white;
    color: #333;
    cursor: pointer;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 介绍部分 */
.intro-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.intro-section h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* 动态内容 */
.dynamic-content {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.greeting {
    font-size: 1.2rem;
    color: #4CAF50;
    margin-bottom: 0.5rem;
}

.time-display {
    color: #2196F3;
    margin-bottom: 0.5rem;
}

.item-counter {
    color: #FF9800;
    margin-bottom: 1rem;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background: #5a6fd8;
}

/* 表单部分 */
.form-section {
    margin: 2rem 0;
}

.form-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.form-container h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.form-actions button {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.form-actions button[type="submit"] {
    background: #4CAF50;
    color: white;
}

.form-actions button[type="submit"]:hover {
    background: #45a049;
}

.form-actions button[type="reset"] {
    background: #f44336;
    color: white;
}

.form-actions button[type="reset"]:hover {
    background: #da190b;
}

/* 菜单部分 */
.menu-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.menu-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.menu-list {
    list-style: none;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.menu-list li a {
    display: block;
    padding: 0.8rem 1.5rem;
    background: #f0f2ff;
    color: #667eea;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-list li a:hover {
    background: #667eea;
    color: white;
    border-color: #5a6fd8;
}

/* 消息部分 */
.messages-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.messages-section h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.message-examples {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.message {
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
}

.message.loading {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.message.success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.message.no-data {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

/* 概念说明部分 */
.concepts-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 2rem 0;
}

.concepts-section h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
    text-align: center;
}

.concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.concept-card {
    background: #f8f9ff;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.concept-card h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.concept-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.concept-card .example {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-family: 'Courier New', monospace;
    color: #333;
}

.concept-card code {
    background: #f0f0f0;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d73a49;
}

/* 页脚 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }

    .language-selector {
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.3);
        padding-left: 0;
        padding-top: 1rem;
        margin-left: 0;
    }

    .container {
        padding: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .menu-list {
        flex-direction: column;
        gap: 0.5rem;
    }

    .concepts-grid {
        grid-template-columns: 1fr;
    }
}